local unitName  =  "Margan_templar"

local unitDef  =  {
--Internal settings
    BuildPic = "Margan_templar.png",
    Category = "TANK SMALL NOTAIR NOTSUB",
    ObjectName = "WL_MArgan_templar.s3o",
    name = "Margan Templar",
    Side = "TANKS",
    TEDClass = "TANK",
    UnitName = "IAE_bulwark",
    script = "WL_Margan_Templar_script.lua",
    Category = [[LAND]],
    iconType = "default",
    
--Unit limitations and properties
    BuildTime = 750,
    Description = "The Margan Tank, good against raiders.",
    MaxDamage = 850,
    RadarDistance = 0,
    SightDistance = 500,
    SoundCategory = "TANK",
    upright = false,
    
--Energy and metal related
    BuildCostEnergy = 900,
    BuildCostMetal = 85,
    
--Pathfinding and related
    Acceleration = 0.8,
    BrakeRate = 0.1,
    FootprintX = 2,
    FootprintZ = 2,
    MaxSlope = 15,
    MaxVelocity = 0.7,
    MaxWaterDepth = 20,
    MovementClass = "Default2x2",
    TurnRate = 700,
    
--Abilities
    Builder = 0,
    CanAttack = 1,
    CanGuard = 1,
    CanMove = 1,
    CanPatrol = 1,
    CanStop = 1,
    LeaveTracks = 0,
    Reclaimable = 0,
    
--Hitbox
--    collisionVolumeOffsets    =  "0 0 0",
--    collisionVolumeScales     =  "20 20 20",
--    collisionVolumeTest       =  1,
--    collisionVolumeType       =  "box",
    
--Weapons and related
    BadTargetCategory = "NOTAIR",
    ExplodeAs = "SMALL_UNIT_EXPLOSION",
    NoChaseCategory = "AIR",

    weapons = {
        [1] = {
            def = "orangeblob",
	     onlyTargetCategory = [[LAND]],
        },
    },
}

local weaponDefs = {
    orangeblob = {
		name = "Flamethrower",
      explosionGenerator      = [[custom:Flash4]],
	  fireStarter             = 100,
	  impulseBoost            = 0,
      impulseFactor           = 0,
CollisionSize=3,
		avoidfriendly = true,
collisionFriendly=1,
				flamegfxtime = 2.2,
		texture1 = "fireball",
sizegrowth=0.7,
      intensity               = 0.1,
      interceptedByShieldType = 3,
      noSelfDamage            = true,
      range                   = 450,
burst=25,
burstRate=0.001,
				sprayangle = 1600,
      reloadtime              = 1,
	  rgbColor                = [[1 1 1]],
	  soundStart              = [[flamethrower]],
      soundTrigger            = true,
      turret                  = true,
      weaponType              = [[Flame]],
      weaponVelocity          = 200,
		damage =
		{
			default = 4,
		},
	},
}


unitDef.weaponDefs = weaponDefs
return lowerkeys({ [unitName]  =  unitDef })

